﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ibuddylib {
    delegate void MethodInvoker();

    class TimelineEvent {
        private DateTime when;
        private MethodInvoker what;

        internal TimelineEvent(DateTime when, MethodInvoker what) {
            this.when = when;
            this.what = what;
        }

        internal DateTime When {
            get {
                return when;
            }
        }

        internal MethodInvoker What {
            get {
                return what;
            }
        }

        internal void Do() {
            what();
        }

        public static bool operator < (TimelineEvent a, TimelineEvent b) {
            return a.when < b.when;
        }

        public static bool operator > (TimelineEvent a, TimelineEvent b) {
            return a.when > b.when;
        }

        public static bool operator <= (TimelineEvent a, TimelineEvent b) {
            return a.when <= b.when;
        }

        public static bool operator >= (TimelineEvent a, TimelineEvent b) {
            return a.when >= b.when;
        }
    }
}
